@echo off
::
:: This batch file is used to copy files from a project into the 
:: SDK Include directory. It also marks those files read only.
::

:: FIND THE SDK DIRECTORY 
:: Prefer the most local sdk dir, 
:: so order these checks such that local dirs set the variable last.

if exist .\*.h      xcopy /D /F /I /R /Y .\*.h      ..\Include\
if exist .\*.inl    xcopy /D /F /I /R /Y .\*.inl    ..\Include\

:: COPY USER SPECIFIED FILES
:==LOOP
if (%~1)==() goto LOOP_END
if exist "%~1" xcopy /D /F /I /R /Y "%~1" ..\Include\
shift
goto LOOP
:==LOOP_END

:: MARK FILES READ ONLY
if exist ..\Include\ attrib +R ..\Include\*

exit /b



:==ERROR_NO_SDK
echo %0: fatal error: Cannot locate SDK directory.
exit 1
